<template>
    <div class="index_container">
    <el-container>
      <el-header>Header</el-header>
      <el-main>
         <el-row>
            <el-col :span="5"  :offset="1">
                <el-card :body-style="{ padding: '0px' }">
                <img src="../assets/images/books/8817345-1_l.jpg" class="image">
                <div class="bottom">
                  <div style="display: flex;">
                      <div class="book_desc" >
                        <div><span>书名:</span></div>
                        <div><span>单价:¥</span></div>
                      </div>
                      
                      <div class="book_car" >
                        <i style="color: orange;font-size:40px;" class=el-icon-shopping-cart-full></i>
                      </div>
                  </div>    
                  <div class="button_inputnumber" style="display: flex;">
                    <div style="margin-top: 5px;"><el-input-number size="small" v-model="num" :min="1"></el-input-number></div>                       
                    <div><el-button type="warning" >购买</el-button></div>
                  </div>
                </div>
                </el-card>
            </el-col>
        </el-row>  
      </el-main>
      <el-main>
           <el-row>
              <el-col :span="5"  :offset="1">
                  <el-card :body-style="{ padding: '0px' }">
                  <img src="../assets/images/books/8817345-1_l.jpg" class="image">
                  <div class="bottom">
                    <div style="display: flex;">
                        <div class="book_desc" >
                          <div><span>书名:</span></div>
                          <div><span>单价:¥</span></div>
                        </div>
                      
                        <div class="book_car" >
                          <i style="color: orange;font-size:40px;" class=el-icon-shopping-cart-full></i>
                        </div>
                    </div>    
                    <div class="button_inputnumber" style="display: flex;">
                      <div style="margin-top: 5px;"><el-input-number size="small" v-model="num" :min="1"></el-input-number></div>                       
                      <div><el-button type="warning" >购买</el-button></div>
                    </div>
                  </div>
                  </el-card>
              </el-col>
          </el-row>  
        </el-main>
        <el-main>
           <el-row>
              <el-col :span="5"  :offset="1">
                  <el-card :body-style="{ padding: '0px' }">
                  <img src="../assets/images/books/8817345-1_l.jpg" class="image">
                  <div class="bottom">
                    <div style="display: flex;">
                        <div class="book_desc" >
                          <div><span>书名:</span></div>
                          <div><span>单价:¥</span></div>
                        </div>
                      
                        <div class="book_car" >
                          <i style="color: orange;font-size:40px;" class=el-icon-shopping-cart-full></i>
                        </div>
                    </div>    
                    <div class="button_inputnumber" style="display: flex;">
                      <div style="margin-top: 5px;"><el-input-number size="small" v-model="num" :min="1"></el-input-number></div>                       
                      <div><el-button type="warning" >购买</el-button></div>
                    </div>
                  </div>
                  </el-card>
              </el-col>
          </el-row>  
        </el-main>
        <el-main>
           <el-row>
              <el-col :span="5"  :offset="1">
                  <el-card :body-style="{ padding: '0px' }">
                  <img src="../assets/images/books/8817345-1_l.jpg" class="image">
                  <div class="bottom">
                    <div style="display: flex;">
                        <div class="book_desc" >
                          <div><span>书名:</span></div>
                          <div><span>单价:¥</span></div>
                        </div>
                      
                        <div class="book_car" >
                          <i style="color: orange;font-size:40px;" class=el-icon-shopping-cart-full></i>
                        </div>
                    </div>    
                    <div class="button_inputnumber" style="display: flex;">
                      <div style="margin-top: 5px;"><el-input-number size="small" v-model="num" :min="1"></el-input-number></div>                       
                      <div><el-button type="warning" >购买</el-button></div>
                    </div>
                  </div>
                  </el-card>
              </el-col>
          </el-row>  
        </el-main>
        <el-main>
           <el-row>
              <el-col :span="5"  :offset="1">
                  <el-card :body-style="{ padding: '0px' }">
                  <img src="../assets/images/books/8817345-1_l.jpg" class="image">
                  <div class="bottom">
                    <div style="display: flex;">
                        <div class="book_desc" >
                          <div><span>书名:</span></div>
                          <div><span>单价:¥</span></div>
                        </div>
                      
                        <div class="book_car" >
                          <i style="color: orange;font-size:40px;" class=el-icon-shopping-cart-full></i>
                        </div>
                    </div>    
                    <div class="button_inputnumber" style="display: flex;">
                      <div style="margin-top: 5px;"><el-input-number size="small" v-model="num" :min="1"></el-input-number></div>                       
                      <div><el-button type="warning" >购买</el-button></div>
                    </div>
                  </div>
                  </el-card>
              </el-col>
          </el-row>  
        </el-main>
        <el-main>
           <el-row>
              <el-col :span="5"  :offset="1">
                  <el-card :body-style="{ padding: '0px' }">
                  <img src="../assets/images/books/8817345-1_l.jpg" class="image">
                  <div class="bottom">
                    <div style="display: flex;">
                        <div class="book_desc" >
                          <div><span>书名:</span></div>
                          <div><span>单价:¥</span></div>
                        </div>
                      
                        <div class="book_car" >
                          <i style="color: orange;font-size:40px;" class=el-icon-shopping-cart-full></i>
                        </div>
                    </div>    
                    <div class="button_inputnumber" style="display: flex;">
                      <div style="margin-top: 5px;"><el-input-number size="small" v-model="num" :min="1"></el-input-number></div>                       
                      <div><el-button type="warning" >购买</el-button></div>
                    </div>
                  </div>
                  </el-card>
              </el-col>
          </el-row>  
        </el-main>
      <el-footer>Footer</el-footer>
    </el-container>
    </div>
</template>
<script>
export default {
    data(){
        return{
            booksList:[],//商品数组
            num:1,//购买数量
        }
    },
    methods: {
        /**
         * 获得商品信息
         */
       queryBooks(){
        this.$axios
                .get("book/queryBooks")
                .then(response=>{
                    this.booksList =response.data;
                })
                .catch(err=>{
                    alert(err)
                })
       }
    },
    created(){
        // this.queryBooks();
    }
}
</script>
<style scoped>
.index_container{
    margin: 0px auto;
    width: 80%;

}
 .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  .el-main {
    background-color: #E9EEF3;
    color: #333;
  }
  
  .book_desc{
    width:70%;
  }
  .book_car{
    width:30%;
    margin-top: 5px;
  }
  .book_desc div{
    margin-top: 10px;
  }
  .button_inputnumber div{
   margin: auto;
  }
  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }
  .image {
    height: 260px;
    width: 100%;
    display: block;
  }

  
</style>